package models;


import java.text.SimpleDateFormat;
import java.util.*;

import models.*;
import javax.persistence.*;
import javax.persistence.criteria.CriteriaBuilder.In;

import com.avaje.ebean.Ebean;
import com.avaje.ebean.Expr;
import com.avaje.ebean.Expression;
import com.avaje.ebean.ExpressionList;
import com.avaje.ebean.FetchConfig;
import com.avaje.ebean.Query;
import com.avaje.ebean.RawSql;
import com.avaje.ebean.RawSqlBuilder;
import com.avaje.ebean.validation.NotNull;

import play.db.ebean.*;
import play.data.format.*;
import play.data.validation.*;


/**
 * User entity managed by Ebean
 */
@Entity
@Table(name="lab_technician_details")
public class LabDetails extends Model {

	public static final long serialVersionUID = 1L;

	@Id
	@Column(name="idlab_technician_id")
	public long id;

	@OneToOne
    @JoinColumn(name="lab_technician_person_id")
    public User technician;

    @Column(name="confirmed")
    public String confirmed="N";

	@OneToOne
    @JoinColumn(name="idlab")
    public Labs labs;

    
    // -- Queries

    public static Model.Finder<Long,LabDetails> find = new Model.Finder(Long.class, LabDetails.class);

    public static LabDetails getLabDetails(long labtechid) {    
    	LabDetails lab =find
    												.where().eq("lab_technician_person_id",labtechid)
    												.findUnique();
    	return lab;
    			
    }
}

